<layout name="Index/layout" />

<div class="box-form form-edit">
    <div class="tit">
        <foreach name="Think.config.CONFIG_GROUPS" key="k" item="v">
        <?php if($k >10)break; ?>
        <a href="{:U('groups?id='.$k)}" <eq name="k" value="$groups">class="current"</eq> >{$v}</a>
        </foreach> 
    </div>
    <div class="con">
        <form class="AjaxForm" data-action="{:U()}" method="post" >
            <table class="bordered color">

    <tr>
        <th colspan="2">
            {:C('CONFIG_GROUPS.'.$groups)}
        </th>
    </tr>
    <foreach name="list" item="v">
    <php>if(!$v['status']): continue;endif;</php>
    <tr>
        <td>{$v.title}:</td>
        <td>
            <switch name="v.type">
            <case value="1|3">
                <input type="text" name="{$v.name}" value="{$v.value}" >
            </case>
            <case value="2|11">
                <textarea name="{$v.name}">{$v.value}</textarea>
            </case>
            <case value="9">
                <input id="{$v.name}_1" type="radio" name="{$v.name}" value="1" <eq name="v.value" value="1">checked</eq> ><label for="{$v.name}_1">开启</label>
                <input id="{$v.name}_0" type="radio" name="{$v.name}" value="0" <eq name="v.value" value="0">checked</eq> ><label for="{$v.name}_0">关闭</label>
            </case>
            <case value="10">
                <select name="{$v.name}">
                <volist name=":str_arr($v['extra'])" id="vo">
                    <option value="{$key}" <eq name="v.value" value="$key">selected</eq>>{$vo}</option>
                </volist>
                </select>
            </case>
            </switch>
            <span class="input-tip">{$v.remark}</span>
        </td>
    </tr>
    </foreach> 

                <tr>
                    <td class="td-2" colspan="2">
                        <input type="submit" class="btn-big btn-blue" value="提交">
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <block name="extra"></block>
</div>



<script type="text/javascript">
seajs.use(['ajax'],function(ajax){
    ajax.get();
    ajax.confirm();
    ajax.html();
    ajax.form();
});
</script>